{% set page_name = "展示硬币" %}
{% import "components/nothing.html" as nothing with context %}
{% import "components/paginator.html" as paginator with context %}
{% extends "coin_base.html" %}
{% block coin_content %}
<div class="row">
  <div class="medium-12 columns">
    <div class="section">
      <div class="section__header">
        <h1 class="section__title">{{ _('所有有过硬币的学员') }}</h1>
      </div>
      <div class="section__body no-padding">
        <div data-fragment-id="ranking">
          {% if not udocs.length %}
          {{ nothing.render('没人有过硬币！') }}
          {% else %}
          <table class="data-table">
            <colgroup>
		<col class="col--uid" style="width:5rem">
                <col class="col--user">
                <col class="col--groups"  style="width:8rem">
                <col class="col--coin_all" style="width:8rem">
                <col class="col--coin_now" style="width:8rem">
                <col class="col--actions" style="width:10rem">
            </colgroup>
            <thead>
              <tr>
                <th class="col--uid">{{ _('User ID') }}</th>
                <th class="col--user">{{ _('Username') }}</th>
                <th class="col--groups"><a href="{{ url('coin_show') }}">{{ _('小组') }}</a></th>
                <th class="col--coin_all">{{ _('累计获取硬币') }}</th>
                <th class="col--coin_now">{{ _('当前剩余硬币') }}</th>
                <th class="col--actions">{{ _('Actions') }}</th>
	      </tr>
            </thead>
            <tbody>
              {%- for udoc in udocs -%}
              <tr>
                <td class="col--uid">{{ udoc._id }}</td>
                <td class="col--user">
		  {{ user.render_inline(udoc) }}
                </td>
                <td class="col--groups">
                  {%- for group in groups -%}
                  {%- if udoc._id in group.uids -%}
                    <a href="{{ url('coin_show') }}?group={{ group.name }}">{{ group.name }}</a>{{ ' ' }}
                  {%- endif -%}
                  {%- endfor -%}
                </td>
                <td>{{ udoc.coin_all }}</td>
                <td>{{ udoc.coin_now }}</td>
		<td><a href="{{ url('coin_bill') }}?uid={{ udoc._id }}">{{ _('查看明细') }}</a>  <a href="{{ url('coin_inc') }}?uname={{ udoc.uname }}">{{ _('发放硬币') }}</a></td>
              </tr>
              {%- endfor -%}
            </tbody>
          </table>         
          {{ paginator.render(page, upcount) }}
	  {% endif %}
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}
